﻿using System;
using Microsoft.Xna.Framework;


namespace LoD.WPClientLibrary.Helper {
    public static class AngleCalculations {
        public static float TargetAngle(this Vector2 p1, Vector2 p2) { return TargetAngle(p1.X, p1.Y, p2.X, p2.Y); }

        public static float TargetAngle(double x1, double y1, double x2, double y2) {
            var deltaX = (x2 - x1);
            var deltaY = (y2 - y1);
            return (float)Math.Atan2(deltaY, deltaX);
        }
    }
}